package gorails.com;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;



public class DestinationAdapter extends BaseAdapter 
{


	private ArrayList<String> Setting=new ArrayList<String>();

	private LayoutInflater mInflater;
	public DestinationAdapter(Context context,  ArrayList<String> name) 
	{
	    this.mInflater = LayoutInflater.from(context);
	    this.Setting=name;

	}

	public int getCount() {
	    return this.Setting.size();
	}

	public Object getItem(int position) {
	    return position;
	}

	public long getItemId(int position) {
	    return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) 
	{
	    final ViewHolder holder;
	    if (convertView == null) 
	    {
	        convertView = mInflater.inflate(R.layout.list_item_1, null);
	        holder = new ViewHolder();
	        holder.Setting = (TextView) convertView.findViewById(R.id.textViewItem);
	        convertView.setTag(holder);
	    } 
	    else 
	    {
	        holder = (ViewHolder) convertView.getTag();
	    }





	    holder.Setting.setText    (Setting.get(position));


	    return convertView;

	}
	class ViewHolder {
	    TextView Setting;

	}
}
